import {UPLOAD_PLUGIN, CHECK_PLUGIN, INSTALL_PLUGIN, UNINSTALL_PLUGIN, PLUGIN_LIST} from '@/services/api'
import {request, METHOD} from '@/utils/request'
import { upload } from '@/utils/upload'

/**
 * 上传接口
 * @param multipartFile
 * */

// 上传插件接口
export function uploadPlugin(formData) {
    return upload(UPLOAD_PLUGIN, formData);
}

// 校验插件接口
export function checkPlugin(filename) {
    return request(CHECK_PLUGIN, METHOD.GET, {
        filename
    })
}

// 确认安装插件
export function installPlugin(reqData) {
    return request(INSTALL_PLUGIN, METHOD.GET, reqData)
}

// 卸载插件
export function uninstallPlugin(id) {
    return request(UNINSTALL_PLUGIN, METHOD.GET, {
        id
    })
}

// 查询插件列表
export function getPluginList(reqData) {
    return request(PLUGIN_LIST, METHOD.GET, reqData)
}
